iOS Bug 汇总

1. objc[xxxx]: Cannot form weak reference to instance (xxxx) of class xxxx. It is possible that this object was over-released, or is in the process of deallocation.

1
2
3
4
5
解决方案:

1. 不要在 dealloc 方法中,使用 weak self

2. A控制器(包含scrollView及其子类,并设置了其代理),B控制器(webView,并设置了webView.scrollView.delegate = self),当A push 到 B,然后B pop回 A时,会引起程序崩溃。解决方案就是再B将要退出时把webView.scrollView.delegate = nil。

2. object file was built for newer iOS version (8.1) than being linked (7.0)

1
2
3
4
5
解决方案:

1. 查看是否在导入.h文件时,误导入了.m文件。

2. 在Build Settings -> other lingkr Flags 中添加 -w

3. The operation couldn’t be completed. (LaunchServicesError error 0.)

1
2
3
4
5
解决办法:
第1种方法.点击当前的模拟器,点击IOS Simulator->Reset Content and Settings...->Reset,然后会重置模拟器,再编译代码可登录模拟器成功
第2种方法.点击Xcode->Product->Clean
第3种方法.将模拟器上的当前运行的app删除,再重新加载(长按模拟器的屏幕,点击当前报错的app 删除)
第4种方法.在info.plist文件中修改bundle的版本号

4. Could not find Developer Disk Image

1
2
3
是由于Xcode支持的最高版本低于真机的系统版本,才会导致此类问题发生。
解决方案一:升级xcode到最新版本
解决方案二:添加 真机系统版本的资源包,到路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 中
如果觉得写的不错,那就打赏一下吧!